import styles from './index.module.scss'

export default  function HouseSupport (props) {
  
  const HOUSE_PACKAGE = [
    {
      id: 1,
      name: '衣柜',
      icon: 'icon-wardrobe',
    },
    {
      id: 2,
      name: '洗衣机',
      icon: 'icon-wash',
    },
    {
      id: 3,
      name: '空调',
      icon: 'icon-air',
    },
    {
      id: 4,
      name: '天然气',
      icon: 'icon-gas',
    },
    {
      id: 5,
      name: '冰箱',
      icon: 'icon-ref',
    },
    {
      id: 6,
      name: '暖气',
      icon: 'icon-Heat',
    },
    {
      id: 7,
      name: '电视',
      icon: 'icon-vid',
    },
    {
      id: 8,
      name: '热水器',
      icon: 'icon-heater',
    },
    {
      id: 9,
      name: '宽带',
      icon: 'icon-broadband',
    },
    {
      id: 10,
      name: '沙发',
      icon: 'icon-sofa',
    },
  ]

  const supports = HOUSE_PACKAGE.filter(item => props.data.includes(item.name))
  console.log('====================================');
  console.log(supports);
  console.log('====================================');
  return (
    <div className={styles.support}>
        {supports.map(item => 
         <div className={styles.support_item} key={item.id}>
            <span className={`iconfont ${item.icon}`}></span>
            <span>{item.name}</span>
         </div>
        )}
    </div>
  )
}